package com.springboot.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.blog.beans.Blog;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BlogDao extends BaseMapper<Blog> {
    //分页查询
    List<Blog> queryForItems(@Param(value = "begin") int begin, @Param(value = "pageSize") Integer pageSize);

    List<Blog> queryStaForItems(@Param(value = "begin") int begin, @Param(value = "pageSize") Integer pageSize);

    List<Blog> queryBlogForItemclass(@Param(value = "begin") int begin, @Param(value = "pageSize") Integer pageSize,Integer blogClassifyId);


    int queryclassCount(Integer blogClassifyId);

    //查询状态为1的记录条数
    int queryStaCount();

    //前台用户博客文章分页查询
    List<Blog> queryBlogForItems(@Param(value = "begin") int begin, @Param(value = "pageSize") Integer pageSize,String blogUserUsername);

    //根据用户名查询发布文章记录数
    int findUserBlogCount(String blogUserUsername);

    //访问量
    int updateView(Integer blogId);

    //查询总访问量
    int selectAllView();

    //统计当天添加文章条数
    int addCountBlog();

    //查询所有文章降序排列
    List<Blog> selectAllBlog();
}
